home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Very Best of Atari Inside
/
The Very Best of Atari Inside 1.iso
/
mint
/
mntlib25
/
_cmpdf2.s
< prev
next >
Wrap
Text File
|
1992-09-29
|
958b
|
57 lines
| double floating point compare routine
|
| written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
| Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
|
|
| Revision 1.1, kub 12-89 :
| Ported over to 68k assembler
|
| Revision 1.0:
| original 8088 code from P.S.Housel
.text
.even
.globl __cmpdf2, ___cmpdf2
| additional entry points for gcc2
.globl ___eqdf2, ___nedf2, ___gtdf2, ___gedf2, ___ltdf2, ___ledf2
__cmpdf2:
___cmpdf2:
___eqdf2:
___nedf2:
___gtdf2:
___gedf2:
___ltdf2:
___ledf2:
moveml sp@(4),d0-d1/a0-a1 | get u and v
tstl d0 | check sign bit
bpl 1f
negl d1 | negate
negxl d0
bchg #31,d0 | toggle sign bit
1:
exg a0,d0
exg a1,d1
tstl d0 | check sign bit
bpl 2f
negl d1 | negate
negxl d0
bchg #31,d0 | toggle sign bit
2:
cmpl d0,a0
blt lt
bgt gt
cmpl d1,a1
bhi gt
beq eq
lt:
moveq #-1,d0
rts
eq:
clrl d0
rts
gt:
moveq #1,d0
rts